<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 设置输入框 -->
    <input type="text" name="text01" id="text01" width="300px" height="300px" value="请输入...." disabled>
    <br>
    <br>
    <br>
    <!-- 设置按钮 -->
    <button >点我输出文本框内容</button>
</body>
<script>
    //设置事件源
    let text=document.querySelector("input");
    let button=document.querySelector("button");
    //设置事件类型
    button.onclick=function(){
        console.log(text.value);
    }
</script>
</html>